//
//  Type_2ViewController.m
//  Travel_M_Travel
//
//  Created by Sun on 15/3/27.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "Type_2ViewController.h"
#import "RecommendHandler.h"
#import "AboutDataData.h"
#import "UIImageView+WebCache.h"
#import "AboutType_2Data.h"
#import "Type_2addCViewCell.h"
#import "HFCollectionRView.h"



@interface Type_2ViewController ()<UICollectionViewDataSource, UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
@property (nonatomic, retain) NSMutableArray *messageArr;
@property (nonatomic, retain) NSMutableArray *photoArr;
@property (nonatomic, retain) UICollectionView *colView;


@end

@implementation Type_2ViewController

- (void)dealloc{
    [_messageArr release];
    [_photoArr release];
    [_colView release];
    [super dealloc];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self dataHandler];
    
    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
    
    flowLayout.sectionInset = UIEdgeInsetsMake(0, 10, 0, 10);
    [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
    // 最小行间距
    flowLayout.minimumLineSpacing = 15;
    // 如果有多个区可以拉动
    [flowLayout setScrollDirection:UICollectionViewScrollDirectionVertical];
    
    self.colView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) collectionViewLayout:flowLayout];
    _colView.dataSource = self;
    _colView.delegate = self;
    
    _colView.backgroundColor = [UIColor yellowColor];
    
//    [_colView registerClass:<#(Class)#> forCellWithReuseIdentifier:<#(NSString *)#>]
    
    
    
    
    
}


- (void)dataHandler
{
    NSString *str = [[NSString stringWithFormat:@"http://api.breadtrip.com/trips/%@/waypoints/?gallery_mode=1", _typeVData2.idNumer] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
//    NSLog(@"!!!!!!!!!!!!!!wc%@", str);
    [RecommendHandler getDataWithUrl:str completion:^(NSDictionary *responseObject) {
        self.messageArr = [responseObject objectForKey:@"days"];
        
        
    }];
}












- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
